package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {
    @Select("select * from users")
    List<User> findAll();
    @Insert("insert into users value(#{username},#{password},#{age},#{sex},#{email})")
    void save(User user);
    @Update("update users setusername=#{username},password=#{password},age=#{age},sex=#{sex},email=#{email} where id=#{id}")
    void updateUser(User user);
    @Delete("delete from users where id=#{id}")
    void delUser(User user);
}
